home *** CD-ROM | disk | FTP | other *** search
-
- Inspired by POPMENU from BWTOOLS by Dave Evers and using mouse
- and screen handling routines from ADVBAS by Thomas Hanlin III,
- POPMOUSE is hereby placed in the Public Domain.
-
- This subroutine was tested with ADVBAS v3.4, 06/25/87
- QuickBasic v3.0, 04/07/87
-
- Ray Schwarz 76012,133
-
- Version 1.0 08/22/87
-
-
- POPMOUSE
-
- Purpose: Used to select options from several popup menu windows
- using the cursor keys or the mouse to move a 'select bar'.
- Selection is made by the Enter key or the left mouse button.
-
- CALL POPMOUSE(PROMPTS$(SET%),L%(SET%),SET%,ITEMS$(),FRAME%,FORE%,
- BACK%,HFORE%,HBACK%,QUADRANT$,SHADOW%,CHOICE%)
-
- Passed:
-
- PROMPTS$ - A string array holding the Menu Headings which you
- wish to place in the header position (top row) of the
- window. The length of this string will determine the
- width of the menu window unless a choice description
- in array ITEMS$() below is longer.
-
- L%(SET%) - An integer array with the number of choices in the
- menu set.
-
- SET% - Used to select which menu to display
-
- ITEMS$(,) - A two-dimensional array (i.e. ITEMS$(1,1) holding the
- actual menu item strings. The first dimension holds
- the menu number, and the second holds the item number
- within a menu. Thus, ITEMS$(1,1) would be the first
- item in Menu #1; and ITEMS$(5,10) would be the 10th
- item in Menu #5.
-
- NOTE: In order for the highlighted 'select bar'
- to be of constant length for each menu, the
- length of the menu item descriptions for
- each set must be equal. This can easily be
- done by adding spaces to the end of each
- description as necessary.
-
- FRAME% - An integer defining the type of frame style for the
- window as follows:
-
- 0 - No frame. Just a border of spaces
- of the background color.
-
- 1 - A single line frame.
-
- 2 - A double line frame.
-
- 3 - A single horizontal line,
- double vertical line frame.
-
- 4 - A double horizontal line,
- single vertical line frame.
-
- FORE% - The foreground color; ranging from 0 (BLACK) to 15
- (BRIGHT WHITE). This will be the color of the frame.
-
- BACK% - The background color (the color of the window). Can
- range from 0 (BLACK) to 7 (WHITE).
-
- HFORE% - The foreground color of the Header.
-
- HBACK% - The background color of the Header.
-
- QUADRANT$ - A string which defines where on the
- screen the window will be placed; used
- as follows:
-
- ---------------------------
- | . |
- | 1 . 2 |
- | . |
- |.............0.............|
- | . |
- | . |
- | 4 . 3 |
- | . |
- ---------------------------
-
-
- "0" - In the exact center of the
- screen; centered according
- to menu size.
-
- "1" - Upper Left Quadrant.
-
- "2" - Upper Right Quadrant.
-
- "3" - Lower Right Quadrant.
-
- "4" - Lower Left Quadrant.
-
- "rr:cc" - Specifies exact coordinates
- of upper left corner of window
- to be row rr and column cc
- (two digits each).
-
-
-
- SHADOW% - A switch to determine if menu window will have a
- black shadow underneath. 1 will produce shadow, 0
- will not.
-
- Returns:
-
- CHOICE% - An integer with the number of the item selected.
- This can be used in an ON SELECT% GOSUB ....
- statement to route program flow to the desired
- section. If [ESC] is pressed, SELECT% will be 0.
-
-
- Other files:
-
- POPMOUSE.BAS - QuickBasic program to demo POPMOUSE
- NEWLIB.BLD - Buildfile to add POPMOUSE to the files contained in
- ADVBAS.EXE user library.
-
- To add:
- 1. Compile POPMOUSE to .obj (using BRUN.LIB) |
- 2. Extract the .OBJ files from OBJECT.ARC included with
- ADVBAS to the same disk/directory.
- 3. Enter BUILDLIB < NEWLIB.BLD
- 4. The resulting file "NEWLIB.EXE" will have all of the
- ADVBAS routines as well as POPMOUSE.
-
- A similar process can be followed to add POPMOUSE to the
- ADVBAS.LIB using the /o (using BCOM.LIB) option and the MASM |
- LIB program or alternately the POPMOUSE.OBJ (again /o) can be
- added during the LINK process:
-
- LINK prog+POPMOUSE,.....